
//- This Source Code Form is subject to the terms of the Mozilla Public
//- License, v. 2.0. If a copy of the MPL was not distributed with this
//- file, You can obtain one at http://mozilla.org/MPL/2.0/.
//-
//- Copyright (c) 2021-present Kaleidos Ventures SL

fieldset.search-list
    label(
        for="items-filter"
    ) {{ label }}

    a.btn-link.show-closed(
        href=""
        ng-if="filterClosed"
        ng-click="toggleShowClosed()"
    )
        tg-svg(svg-icon="icon-folder")
        span(ng-if="!showClosed") {{ textShowClosed }}
        span(ng-if="showClosed") {{ textHideClosed }}

    input.items-filter(
        id="items-filter"
        type="text"
        placeholder="{{ placeholder }}"
        ng-model="searchText"
        ng-change="filterItems(searchText)"
    )
    ul
        li.choice(
            ng-repeat="item in items track by item.id"
            ng-class="{ 'selected': item.id == currentSelected.id }"
            data-choice-id="{{ item.id }}"
            ng-if="isVisible(item)"
            ng-disabled="itemDisabled(item)"
        )
            ng-include(src="templateUrl")

    p.no-stories-found(
        ng-show="!items.length"
    ) {{ noItemsText }}
